<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BOSS Afterburner: Rolke.C Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BOSS Afterburner
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('Rolke_8C_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">Rolke.C</div>  </div>
</div><!--header-->
<div class="contents">
<a href="Rolke_8C.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="YamlLoader_8h.html">File/YamlLoader.h</a>&quot;</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="Error_8h.html">Functions/Error.h</a>&quot;</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="TerminalIO_8h.html">Functions/TerminalIO.h</a>&quot;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &quot;Riostream.h&quot;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &quot;TROOT.h&quot;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &quot;TRolke.h&quot;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;TSystem.h&quot;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespacestd.html">std</a>;</div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="keyword">using namespace </span><a class="code" href="namespaceBOSS__Afterburner_1_1TerminalIO.html">BOSS_Afterburner::TerminalIO</a>;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="group__Afterburner__scripts.html#ga485a4127e521f6a858d8238c5a4bee5c">   17</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group__Afterburner__scripts.html#ga485a4127e521f6a858d8238c5a4bee5c">Rolke</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* config_file)</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;{</div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;  <a class="code" href="classYamlLoader.html">YamlLoader</a>  conf(config_file);</div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;  <span class="keyword">const</span> <span class="keyword">auto</span>&amp; model = conf[<span class="stringliteral">&quot;Model&quot;</span>];</div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;  <span class="keywordflow">if</span>(!model) <a class="code" href="Error_8h.html#aebda0a072e31a60b750222e289297538">EXCEPTION</a>(<span class="stringliteral">&quot;YAML file does not contain Model definition&quot;</span>);</div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;  Int_t    x     = model[<span class="stringliteral">&quot;Number of observed events in the experiment&quot;</span>].as&lt;Int_t&gt;();</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;  Int_t    y     = model[<span class="stringliteral">&quot;Number of observed events in background region&quot;</span>].as&lt;Int_t&gt;();</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;  Double_t bm    = model[<span class="stringliteral">&quot;Estimate of the background&quot;</span>].as&lt;Double_t&gt;();</div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;  Double_t sdb   = model[<span class="stringliteral">&quot;Standard deviation of the background estimate&quot;</span>].as&lt;Double_t&gt;();</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;  Double_t em    = model[<span class="stringliteral">&quot;Estimate of the efficiency&quot;</span>].as&lt;Double_t&gt;();</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  Double_t sde   = model[<span class="stringliteral">&quot;Standard deviation of the efficiency estimate&quot;</span>].as&lt;Double_t&gt;();</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;  Double_t tau   = model[<span class="stringliteral">&quot;Ratio between signal and background region&quot;</span>].as&lt;Double_t&gt;();</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;  Int_t    m     = model[<span class="stringliteral">&quot;Number of MC events generated&quot;</span>].as&lt;Int_t&gt;();</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;  Int_t    z     = model[<span class="stringliteral">&quot;Number of MC events observed&quot;</span>].as&lt;Int_t&gt;();</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;  Double_t e     = model[<span class="stringliteral">&quot;True efficiency (considered known)&quot;</span>].as&lt;Double_t&gt;();</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;  Double_t b     = model[<span class="stringliteral">&quot;Background expectation value (considered known)&quot;</span>].as&lt;Double_t&gt;();</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;  Double_t alpha = model[<span class="stringliteral">&quot;Confidence Level&quot;</span>].as&lt;Double_t&gt;();</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Number of observed events in the experiment: &quot;</span> &lt;&lt; x &lt;&lt; endl;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Number of observed events in background region: &quot;</span> &lt;&lt; y &lt;&lt; endl;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Estimate of the background: &quot;</span> &lt;&lt; bm &lt;&lt; endl;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Standard deviation of the background estimate: &quot;</span> &lt;&lt; sdb &lt;&lt; endl;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Estimate of the efficiency: &quot;</span> &lt;&lt; em &lt;&lt; endl;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Standard deviation of the efficiency estimate: &quot;</span> &lt;&lt; sde &lt;&lt; endl;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Ratio between signal and background region: &quot;</span> &lt;&lt; tau &lt;&lt; endl;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Number of MC events generated: &quot;</span> &lt;&lt; m &lt;&lt; endl;</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Number of MC events observed: &quot;</span> &lt;&lt; z &lt;&lt; endl;</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;True efficiency (considered known): &quot;</span> &lt;&lt; e &lt;&lt; endl;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Background expectation value (considered known): &quot;</span> &lt;&lt; b &lt;&lt; endl;</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;Confidence Level: &quot;</span> &lt;&lt; alpha &lt;&lt; endl;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  TRolke   tr;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  Double_t ul; <span class="comment">// Upper limit</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  Double_t ll; <span class="comment">// Lower limit</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;  tr.SetCL(alpha);</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;  tr.SetPoissonBkgBinomEff(x, y, z, tau, m);</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;  tr.GetLimits(ll, ul);</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  cout &lt;&lt; endl;</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;The Profile Likelihood interval is:&quot;</span> &lt;&lt; endl;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;  cout &lt;&lt; <span class="stringliteral">&quot;[&quot;</span> &lt;&lt; ll &lt;&lt; <span class="stringliteral">&quot;,&quot;</span> &lt;&lt; ul &lt;&lt; <span class="stringliteral">&quot;]&quot;</span> &lt;&lt; endl;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;}</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="Rolke_8C.html#a0ddf1224851353fc92bfbff6f499fa97">   63</a></span>&#160;<span class="keywordtype">int</span> <a class="code" href="Rolke_8C.html#a0ddf1224851353fc92bfbff6f499fa97">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>* argv[])</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;{</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  <a class="code" href="namespaceBOSS__Afterburner_1_1TerminalIO.html#a5b35019e4f74baaa75cd1f5de2a97fb7">CheckMainArguments</a>(argc, argv, 1);</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;  <a class="code" href="group__Afterburner__scripts.html#ga485a4127e521f6a858d8238c5a4bee5c">Rolke</a>(argv[1]);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;  <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;}</div><div class="ttc" id="namespacestd_html"><div class="ttname"><a href="namespacestd.html">std</a></div></div>
<div class="ttc" id="Rolke_8C_html_a0ddf1224851353fc92bfbff6f499fa97"><div class="ttname"><a href="Rolke_8C.html#a0ddf1224851353fc92bfbff6f499fa97">main</a></div><div class="ttdeci">int main(int argc, char *argv[])</div><div class="ttdef"><b>Definition:</b> <a href="Rolke_8C_source.html#l00063">Rolke.C:63</a></div></div>
<div class="ttc" id="Error_8h_html"><div class="ttname"><a href="Error_8h.html">Error.h</a></div></div>
<div class="ttc" id="YamlLoader_8h_html"><div class="ttname"><a href="YamlLoader_8h.html">YamlLoader.h</a></div></div>
<div class="ttc" id="Error_8h_html_aebda0a072e31a60b750222e289297538"><div class="ttname"><a href="Error_8h.html#aebda0a072e31a60b750222e289297538">EXCEPTION</a></div><div class="ttdeci">#define EXCEPTION(VARIABLE)</div><div class="ttdef"><b>Definition:</b> <a href="Error_8h_source.html#l00007">Error.h:7</a></div></div>
<div class="ttc" id="TerminalIO_8h_html"><div class="ttname"><a href="TerminalIO_8h.html">TerminalIO.h</a></div></div>
<div class="ttc" id="namespaceBOSS__Afterburner_1_1TerminalIO_html"><div class="ttname"><a href="namespaceBOSS__Afterburner_1_1TerminalIO.html">BOSS_Afterburner::TerminalIO</a></div><div class="ttdef"><b>Definition:</b> <a href="TerminalIO_8h_source.html#l00015">TerminalIO.h:15</a></div></div>
<div class="ttc" id="namespaceBOSS__Afterburner_1_1TerminalIO_html_a5b35019e4f74baaa75cd1f5de2a97fb7"><div class="ttname"><a href="namespaceBOSS__Afterburner_1_1TerminalIO.html#a5b35019e4f74baaa75cd1f5de2a97fb7">BOSS_Afterburner::TerminalIO::CheckMainArguments</a></div><div class="ttdeci">void CheckMainArguments(int argc, char *argv[], int required=1)</div><div class="ttdef"><b>Definition:</b> <a href="TerminalIO_8cxx_source.html#l00013">TerminalIO.cxx:13</a></div></div>
<div class="ttc" id="group__Afterburner__scripts_html_ga485a4127e521f6a858d8238c5a4bee5c"><div class="ttname"><a href="group__Afterburner__scripts.html#ga485a4127e521f6a858d8238c5a4bee5c">Rolke</a></div><div class="ttdeci">void Rolke(const char *config_file)</div><div class="ttdoc">Based on the Rolke example that comes with ROOT, but adapted with YamlLoader. </div><div class="ttdef"><b>Definition:</b> <a href="Rolke_8C_source.html#l00017">Rolke.C:17</a></div></div>
<div class="ttc" id="classYamlLoader_html"><div class="ttname"><a href="classYamlLoader.html">YamlLoader</a></div><div class="ttdef"><b>Definition:</b> <a href="YamlLoader_8h_source.html#l00014">YamlLoader.h:14</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_53e6fa9553ac22a5646d2a2b2d7b97a1.html">scripts</a></li><li class="navelem"><a class="el" href="dir_c236112fe4913aeb638d99efe05f013c.html">D0phi_KpiKK</a></li><li class="navelem"><a class="el" href="Rolke_8C.html">Rolke.C</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
